import { requestClient } from '../request';

export namespace MenuApi {
  export interface BindMenuType {
    id: string;
    perms: Recordable<string[]>;
  }
}

/**
 * 获取用户当前权限
 */
export const getUserMenuAuthApi = () => {
  return requestClient.get('/system/user/getUserAuth');
};

/**
 * 获取权限菜单树
 */
export const getMenuTreeApi = (data = {}) => {
  return requestClient.post('/system/menu/getMenuTree', data);
};

/**
 * 角色绑定权限
 */
export const roleBindMenuApi = (data: MenuApi.BindMenuType) => {
  return requestClient.post('/system/role/bindMenu', data);
};
